Method and device for intra-prediction

ABSTRACT

The multi sample prediction method of the present invention comprises the steps of: determining a sample group consisting of a plurality of samples inside a decoding target block; determining a representative position corresponding to the sample group, inside the decoding target block; determining a representative prediction value for the sample group, on the basis of the determined representative position; and determining the determined representative prediction value as the final prediction value for each of the plurality of samples making up the sample group. The present invention enhances efficiency in encoding/decoding and reduces complexity thereof.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of U.S. Pat. Application No.17/733,182 filed on Apr. 29, 2022, which is a Continuation of U.S. Pat.Application No. 17/138,426 filed on Dec. 30, 2020, now issued as U.S.Pat. No. 11,350,125, which is a continuation of U.S. Pat. ApplicationNo. 17/009,692 filed on Sep. 1, 2020, which is a continuation of U.S.Pat. Application No. 16/374,685 filed on Apr. 3, 2019, which is acontinuation of U.S. Pat. Application No. 14/002,393 filed on Aug. 30,2013, which is a National Stage of International Application No.PCT/KR2012/001791, filed Mar. 12, 2012, and published as WO2012/121575on Sep. 13, 2012, which claims benefit under 35 U.S.C. §119(a) of KoreanPatent Application No. 10-2012-0025095 filed Mar. 12, 2012, and ofKorean Patent Application No. 10-2011-0021170 filed Mar. 10, 2011, inthe Korean Intellectual Property Office, the contents of all of whichare incorporated herein by reference in their entireties. Theapplicant(s) hereby rescind any disclaimer of claim scope in the parentapplication(s) or the prosecution history thereof and advise the USPTOthat the claims in this application may be broader than any claim in theparent application(s).

TECHNICAL FIELD

The present invention relates to image processing and, moreparticularly, to an intra prediction method and an apparatus thereof.

BACKGROUND

Recently, as broadcast service having high definition (HD) resolutionhas expanded internationally as well as domestically, many users becomefamiliar to HD images (or pictures), and accordingly, a large number oforganization or institutions are spurring the development of anext-generation imaging device. Also, as the interest in an HDTV and anultra-high definition (UHD) having resolution of four-fold or greaterthan the HDTV is increasing, a compression technique with respect tomore advanced HD images is required.

For image compression, an inter-prediction technique of predicting asample value included in a current picture from a previous and/orsubsequent picture temporally, an intra-prediction technique ofpredicting a sample value included in a current picture by using sampleinformation included in the current picture, an entropy encodingtechnique of allocating a short code to a symbol having a highappearance frequency and a long code to a symbol having a low appearancefrequency, and the like, may be used.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic block diagram showing a configuration according toan embodiment of an image encoding apparatus to which the presentinvention is applied.

FIG. 2 is a schematic block diagram showing a configuration according toan embodiment of an image decoding apparatus to which the presentinvention is applied.

FIG. 3 is a flow chart illustrating a process of an intra-predictionmethod according to an embodiment of the present invention.

FIGS. 4 a and 4 b are conceptual view explaining a method fordetermining a reference sample according to an embodiment of the presentinvention.

FIG. 5 is a conceptual view schematically showing an embodiment of amethod for determining whether to apply multi-sample prediction anddetermining a sample group according to an embodiment of the presentinvention.

FIG. 6 is a conceptual view schematically showing an embodiment of amethod for determining a representative position of each sample groupaccording to an embodiment of the present invention.

FIG. 7 is a conceptual view schematically showing another embodiment ofa method for determining a representative position of each sample groupaccording to an embodiment of the present invention.

FIG. 8 is a conceptual view schematically showing another embodiment ofa method for determining a representative position of each sample groupaccording to an embodiment of the present invention.

FIG. 9 is a conceptual view schematically showing an embodiment of amethod of determining a representative prediction value of each samplegroup.

FIG. 10 is a conceptual view schematically showing an embodiment of amethod of deriving a prediction value with respect to a plurality ofsamples of a sample group.

FIG. 11 is a conceptual view schematically showing another embodiment ofa method of deriving a prediction value with respect to a plurality ofsamples of a sample group.

FIG. 12 is a conceptual view schematically showing another embodiment ofa method of deriving a prediction value with respect to a plurality ofsamples of a sample group.

BRIEF SUMMARY OF INVENTION Technical Problem

The present invention provides an image encoding method and apparatuscapable of enhancing image encoding/decoding efficiency and reducingcomplexity.

The present invention also provides an image decoding method andapparatus capable of enhancing image encoding/decoding efficiency andreducing complexity.

The present invention also provides an intra-prediction method andapparatus capable of enhancing image encoding/decoding efficiency andreducing complexity.

The present invention also provides a multi-sample prediction method andapparatus capable of enhancing image encoding/decoding efficiency andreducing complexity.

Technical Solution

1. In an aspect, a multi-sample prediction method is provided. Themethod includes: determining a sample group comprised of a plurality ofsamples in a block to be decoded (or a decoding target block);determining a representative position corresponding to the sample groupin the decoding target block; determining a representative predictionvalue with respect to the sample group based on the determinedrepresentative position; and determining the determined representativeprediction value as a final prediction value with respect to each of theplurality of samples constituting the sample group.

2. In the aspect 1, the method may further include: determining whetherto apply multi-sample prediction to the decoding target block by using acoding parameter of the decoding target block, wherein when it isdetermined to apply multi-sample prediction to the decoding targetblock, the steps that follow the sample group determining step may besequentially performed and the coding parameter may include at least oneof a size of the decoding target block and an intra prediction mode ofthe decoding target block.

3. In the aspect 1, in the step of determining a sample group, the sizeand shape of the sample group may be determined according to the codingparameter of the decoding target block, and the coding parameter mayinclude at least one of the size of the decoding target block and theintra prediction mode of the decoding target block.

4. In the aspect 1, in the step of determining a representationposition, one of positions of the plurality of samples constituting thesample group may be selected as a representative position with respectto the sample group.

5. In the aspect 1, in the step of determining a representationposition, a middle position between a plurality of samples constitutingthe sample group may be determined as a representative position withrespect to the sample group.

6. In the aspect 1, in the step of determining a representationposition, a position of a sample existing outside the sample group inthe decoding target block may be determined as a representative positionwith respect to the sample group.

7. In the aspect 1, the step of determining a representation predictionvalue may include: determining a reference position corresponding to therepresentative position based on the intra prediction mode of thedecoding target block; and determining a representative prediction valuewith respect to the sample group based on the reference position.

8. In the aspect 7, when the determined reference position is the sameas a position of a single reference sample with respect to the decodingtarget block, a sample value of the reference sample having the sameposition as the reference position may be determined as therepresentative prediction value in the step of determining arepresentative prediction value.

9. In the aspect 7, when the determined reference position is a positionbetween a plurality of reference samples with respect to the decodingtarget block, a sample value of a reference sample positioned to beclosest to a prediction direction of the decoding target block among theplurality of reference samples may be determined as the representativeprediction value in the step of determining a representative predictionvalue.

10. In the aspect 7, when the determined reference position is aposition between the plurality of reference samples with respect to thedecoding target block, interpolation may be performed on the samplevalues of the plurality of reference samples to determine therepresentative prediction value in the step of determining arepresentative prediction value.

11. In the aspect 7, when the determined reference position is aposition between the plurality of reference samples with respect to thedecoding target block, a sample average value of the plurality ofreference samples may be determined as the representative predictionvalue in the step of determining a representative prediction value.

12. In another aspect, an image decoding method is provided. The methodincludes: determining a sample group comprised of a plurality of samplesin a block to be decoded (or a decoding target block); determining arepresentative position corresponding to the sample group in thedecoding target block; determining a representative prediction valuewith respect to the sample group based on the determined representativeposition; determining the determined representative prediction value asa final prediction value with respect to each of the plurality ofsamples constituting the sample group; and generating a reconstructedimage by using the final prediction value.

13. In another aspect 12, in the step of determining a sample group, thesize and shape of the sample group may be determined according to thecoding parameter of the decoding target block, and the coding parametermay include at least one of a size of the decoding target block and anintra prediction mode of the decoding target block.

14. In another aspect 12, in the step of determining a representationposition, one of positions of the plurality of samples constituting thesample group may be selected as a representative position with respectto the sample group.

15. In another aspect 12, in the step of determining a representationposition, a middle position between a plurality of samples constitutingthe sample group may be determined as a representative position withrespect to the sample group.

16. In another aspect 12, in the step of determining a representationposition, a position of a sample existing outside the sample group inthe decoding target block may be determined as a representative positionwith respect to the sample group.

17. In another aspect 12, the step of determining a representationprediction value may include: determining a reference positioncorresponding to the representative position based on the intraprediction mode of the decoding target block; and determining arepresentative prediction value with respect to the sample group basedon the reference position.

Advantageous Effects

By the image encoding method according to an embodiment of the presentinvention, an image encoding/decoding efficiency can be enhanced andcomplexity can be reduced.

By the image decoding method according to an embodiment of the presentinvention, an image encoding/decoding efficiency can be enhanced andcomplexity can be reduced.

By the intra-prediction method according to an embodiment of the presentinvention, an image encoding/decoding efficiency can be enhanced andcomplexity can be reduced.

By the multi-sample prediction method according to an embodiment of thepresent invention, an image encoding/decoding efficiency can be enhancedand complexity can be reduced.

DETAILED DESCRIPTION

Hereinafter, embodiments of the present invention will be described indetail with reference to the accompanying drawings. In describing thepresent invention, if a detailed explanation for a related knownfunction or construction is considered to unnecessarily divert the gistof the present invention, such explanation will be omitted but would beunderstood by those skilled in the art.

When a component is mentioned as being “connected” to or “accessing”another component, this may mean that it is directly connected to oraccessing the other component, but it is to be understood that anothercomponent may exist therebetween. On the other hand, when a component ismentioned as being “directly connected” to or “directly accessing”another component, it is to be understood that there are no othercomponents in-between.

While terms such as “first” and “second,” etc., may be used to describevarious components, such components must not be understood as beinglimited to the above terms. The above terms are used only to distinguishone component from another. For example, a first component may bereferred to as a second component without departing from the scope ofrights of the present invention, and likewise a second component may bereferred to as a first component.

Also, elements of the embodiments of the present invention areindependently illustrated to show different characteristic functions,and it does not mean that each element is configured as separatedhardware or a single software component. Namely, for the sake ofexplanation, respective elements are arranged to be included, and atleast two of the respective elements may be incorporated into a singleelement or a single element may be divided into a plurality of elementsto perform a function, and the integrated embodiment and dividedembodiment of the respective elements are included in the scope of thepresent invention unless it diverts from the essence of the presentinvention.

Also, some of the elements may be optional to merely enhance theperformance, rather than being essential to perform a constitutionalfunction. The present invention may be implemented by using only theelements requisite for implement the essence of the present invention,excluding elements used to merely enhance the performance, and astructure including only the essential elements excluding the optionalelements merely used to enhance the performance is also included in thescope of the present invention.

FIG. 1 is a schematic block diagram showing a configuration according toan embodiment of an image encoding apparatus to which the presentinvention is applied.

With reference to FIG. 1 , the image encoding apparatus 100 includes amotion estimator 111, a motion compensator 112, an intra-prediction unit120, a switch 115, a subtractor 125, a transform unit 130, aquantization unit 140, an entropy encoding unit 150, a dequantizationunit 160, a inverse transform unit 170, an adder 175, a filter unit 180,and a reference picture buffer 190.

The image encoding apparatus 100 may perform encoding on an input imagein an intra mode or an inter mode and output a bit stream. The intraprediction refers to intra-screen prediction, and the inter predictionrefers to an inter-screen prediction. In the case of the intra mode, aswitch 115 may be changed into intra, and in the case of the inter mode,the switch 115 may be changed into inter. The image encoding apparatus100 may generate a predictive block with respect to an input block ofthe input image, and then, encode a difference between the input blockand the predictive block.

In the case of the intra mode, the intra prediction unit 120 may performspatial prediction by using a sample value of an already encoded blockaround a current block to generate a predictive block.

In the case of the inter mode, the motion estimator 111 may search aregion which is best matched to an input block from a reference imagestored in the reference picture buffer 190 to obtain a motion vectorduring a motion prediction process. The motion compensator 112 mayperform motion compensation by using the motion vector to generate apredictive block.

The subtractor 125 may generate a residual block by a difference betweenthe input block and the generated predictive block. The transform unit130 may perform transform on the residual block to output a transformcoefficient. The quantization unit 140 quantizes the input transformcoefficient according to a quantization parameter to output a quantizedcoefficient.

The entropy encoding unit 150 may perform entropy encoding based onvalues calculated by the quantization unit 140, an encoding parametervalue calculated during an encoding process, and the like, to output abit stream.

When the entropy encoding is applied, a smaller number of bits areallocated to a symbol having a high generation probability and a largernumber of bits are allocated to a symbol having a low generationprobability to represent the symbols, thereby reducing the size of a bitstream with respect to the symbols to be encoded (or encoding targetsymbols). Thus, compression performance of video encoding can beenhanced through entropy encoding. For entropy encoding, the entropyencoding unit 150 may use an encoding method such as exponential golomb,CAVLC (Context-Adaptive Variable Length Coding), CABAC (Context-AdaptiveBinary Arithmetic Coding), or the like.

The image encoding apparatus according to an embodiment of the presentinvention illustrated in FIG. 1 performs inter-predictive coding,namely, inter-screen predictive coding, so a currently encoded image isrequired to be decoded and stored so as to be used as a reference image.Thus, the quantized coefficient is dequantized by the dequantizationunit 160 and inversely transformed by the inverse transform unit 170.The dequantized and inversely transformed coefficient is added to thepredictive block through the adder 175 to generate a reconstructedblock.

The reconstructed block is processed through the filter unit 180, andthe filter unit 180 may apply one or more of a deblocking filter, an SAO(Sample Adaptive Offset), and an ALF (Adaptive Loop Filter) to areconstructed picture. The filter unit 180 may also be called anadaptive in-loop filter. The deblocking filter may remove blockdistortion generated in a boundary between blocks. The SAO may add anappropriate offset value to a sample value in order to compensate for acoding error. The ALF may perform filtering based on a value obtained bya reconstructed image and the original image, and may perform filteringonly when high efficiency is applied. The reconstructed block processedthrough the filter unit 180 may be stored in the reference picturebuffer 190.

FIG. 2 is a schematic block diagram showing a configuration according toan embodiment of an image decoding apparatus to which the presentinvention is applied.

With reference to FIG. 2 , an image decoding apparatus 200 includes anentropy decoding unit 210, a dequantization unit 220, a inversetransform unit 230, an intra prediction unit 240, a motion compensator250, an adder 255, a filter unit 260, and a reference picture buffer270.

The image decoding apparatus 200 may receive a bit stream output from anencoder, perform decoding on the received bit stream in an intra mode orinter mode, and output a reconfigured image, i.e., a reconstructedimage. In the case of the intra mode, a switch may be changed intointra, and in the case of the inter mode, the switch may be changed intointer. The image decoding apparatus 200 may obtain a residual block fromthe received bit stream, generate a predictive block, and add theresidual block and the predictive block to generate a reconfiguredblock, i.e., a reconstructed block.

The entropy decoding unit 210 may perform entropy decoding on the inputbit stream according to a probability distribution to generate symbolsincluding a symbol having a quantized coefficient form. The entropydecoding method is similar to the foregoing entropy encoding method.

When the entropy decoding method is applied, a small number of bits areallocated to a symbol having a high generation probability, and a largenumber of bits are allocated to a symbol having a low generationprobability to represent symbols, thus reducing the size of a bit streamwith respect to the respective symbols. Thus, compression performance ofimage decoding can be enhanced through the entropy decoding method.

The quantized coefficient is dequantized by the dequantization unit 220,inversely transformed by the inverse transform unit 230, and accordingto the results of the dequantization/inverse transform of the quantizedcoefficient, a residual block may be generated.

In the case of the intra mode, the intra prediction unit 240 may performspatial prediction by using a sample value of the already coded blocksaround a current block to generate a predictive block. In the case ofthe inter mode, the motion compensator 250 may perform motioncompensation by using a motion vector and a reference image stored inthe reference picture buffer 270 to generate a predictive block.

The residual block and the predictive block may be added by the adder255, and the added blocks may be processed by the filter unit 260. Thefilter unit 260 may apply one or more of a deblocking filter, an SAO,and an ALF to the reconstructed block or a reconstructed picture. Thefilter unit 260 may output the reconfigured image, i.e., thereconstructed image. The reconstructed image may be stored in thereference picture buffer 270 so as to be used for inter prediction.

Hereinafter, a block refers to a unit of image encoding and decoding. Inimage encoding and decoding, an encoding or decoding unit refers to adivided unit when an image is segmented to be encoded or decoded, so itmay be called a coding unit (CU), a prediction unit (PU), a transformunit (TU), or the like. A single block may be further divided intosub-blocks having a smaller size. Also, hereinafter, a block to beencoded/decoded (or an encoding/decoding target block) may refer to acoding unit or a prediction unit as a current encoding/decoding target.The size of the encoding/decoding target block may be, for example, 2×2,4×4, 8×8, 16×16, 32×32, 64×64, 128×128, or the like.

Meanwhile, the intra prediction may be performed according to an intraprediction mode of an encoding/decoding target block. The number ofintra prediction modes of the encoding/decoding target block may be afixed value, and the fixed value may be 3, 4, 5, 9, 17, 18, 34, 35, orthe like. Each intra prediction mode may indicate a single predictiondirection.

The encoder and the decoder may perform intra prediction by performinginterpolation on a reconstructed sample corresponding to anencoding/decoding target sample. Here, the reconstructed samplecorresponding to the encoding/decoding target sample may be determinedaccording to an intra prediction mode (and/or a prediction direction) ofthe encoding/decoding target block to which the encoding/decoding targetsample belongs. Here, as the size of the encoding/decoding target blockis increased, the number of encoding/decoding target samples may beincreased and the number of times of performing interpolation may beincreased. Thus, the foregoing intra prediction method may have aproblem in which the coding efficiency over complexity is not high in ablock in which encoding/decoding target samples have highcorrelationship.

Thus, an intra prediction method of determining a representativeprediction value with respect to a sample group comprised of a pluralityof samples and predicting a plurality of samples of the sample group byusing the determining representative prediction value at a time to thusreduce an amount of calculation may be provided. Namely, in performingintra prediction on samples in an encoding/decoding target block, theencoder and the decoder may determine a sample group of theencoding/decoding target block and a representative prediction value andpredict a plurality of the sample group by using the determiningrepresentative prediction value. In this case, since the number of timesof performing an interpolation process is reduced, the amount ofcalculation required for intra prediction can be reduced. Hereinafter,the intra prediction method of predicting a plurality of samples of asample group by using a representative prediction value will be referredto as multi-sample prediction.

In the embodiments described hereafter, the encoder will be mainlydescribed. However, this is merely for the sake of explanation and mayalso be applied in the same manner to the decoder unless otherwisementioned. In this case, an encoding target block described hereaftermay be interpreted as a decoding target block.

FIG. 3 is a flow chart illustrating a process of an intra-predictionmethod according to an embodiment of the present invention.

With reference to FIG. 3 , the encoder may determine a reference sampleused for intra prediction of an encoding target block (S310). Here, thereference sample may be determined according to an intra prediction modeand/or a prediction direction of the encoding target block.

The encoder may encode information regarding the intra prediction mode,include the encoded information in a bit stream, and transmit the sameto the decoder. Then, the decoder may perform parsing on the receivedbit stream to derive an intra prediction mode (and/or a predictiondirection), and perform intra prediction on the decoding target blockbased on the derived intra prediction mode (and/or the predictiondirection).

With reference to FIG. 3 , the encoder may determine whether to applymulti-sample prediction, the size of a sample group, and/or a shape of asample group according to an encoding parameter of the encoding targetblock (S320). Here, the sample group may correspond to an applicationunit of multi-sample prediction.

The encoding parameter may include information that may be inferred (oranalogized) during the encoding or decoding process, as well asinformation which is encoded together with a syntax element andtransmitted to the decoder, and may refer to information required forencoding or decoding an image.

The encoding parameter may include, for example, the size of theencoding target block and/or the prediction mode of the encoding targetblock. Namely, the encoder may differently determine whether to applymulti-sample prediction, the size of the sample group and/or the shapeof the sample group according to the size of the encoding target blockand/or the prediction mode of the encoding target block.

When it is determined to apply multi-sample prediction, the encoder maydetermine a representative position with respect to each sample group ofthe encoding target block (S330). Here, the representative position maybe determined according to, for example, positions of a plurality ofsamples constituting each sample group.

For example, the encoder may determine a position of a single among theplurality of samples constituting the sample group, as a representativeposition with respect to the sample group. Also, the encoder maydetermine a middle position of the plurality of samples constituting thesample group, as a representative position with respect to the samplegroup. Also, the encoder may determine a position existing outside thesample group within the encoding target block, as a representativeposition with respect to the sample group.

With reference to FIG. 3 , the encoder may determine a representativeprediction value with respect to each sample group by using at least oneof reference samples with respect to the encoding target block based onthe representative position with respect to each sample group (S340).When the representative prediction value is determined, the encoder maydetermine a sample prediction value with respect to each of theplurality of samples of the sample group corresponding to therepresentative prediction value by using the determined representativeprediction value (S350). For example, a prediction value with respect toeach of the plurality of samples constituting a single sample group maybe determined to be the same value as the representative predictionvalue corresponding to the sample group. Namely, the representativeprediction value may be used as a prediction value of the plurality ofsamples of the corresponding sample group.

A detailed embodiment of the foregoing respective steps (S310, S320,S330, S340, and S350) will be described later.

FIGS. 4 a and 4 b are conceptual view explaining a method fordetermining a reference sample according to an embodiment of the presentinvention.

As described above, the intra prediction may be performed according tothe intra prediction mode (and/or prediction direction) of theencoding/decoding target block. The number of intra prediction modes(and or prediction directions) of the encoding/decoding target block maybe a fixed value, and the fixed value may be 3, 4, 5, 9, 17, 18, 34, 35,or the like. Each of the intra prediction modes may indicate a singleprediction direction.

FIG. 4 a schematically shows an embodiment of prediction directions ofintra prediction modes and mode values allocated to the respectiveprediction directions when thirty-four prediction modes are used. InFIG. 4 a , a plurality of intra prediction modes are illustrated andeach of the intra prediction modes may have different predictiondirections. The numbers allocated to the respective intra predictionmodes are mode values.

With reference to FIG. 4 a , when the mode value is 0, prediction may beperformed in a vertical direction by using pixel values of an adjacentblock, and when the mode value is 1, prediction may be performed in ahorizontal direction by using pixel values of an adjacent block. Also,in the other remaining modes, prediction may be performed by using pixelvalues of an adjacent block according to corresponding angles.

FIG. 4 b illustrates an encoding target block 410 and a reference samplecandidate 420. Each (x,y) illustrated in the encoding target block 410may indicate coordinates of the encoding target sample. In theembodiment illustrated in FIG. 4 b , the size of the encoding targetblock is assumed to be 8×8.

As mentioned above, the reference sample used for intra prediction ofthe encoding target block 410 may be determined to be differentaccording to an intra prediction mode and/or prediction direction of theencoding target block. Here, the intra prediction mode of the encodingtarget block may be determined, for example, as shown in FIG. 4 a .Table 1 below shows the reference sample determined according to theintra prediction mode of the encoding target block according to anembodiment of the present invention.

TABLE 1 Prediction mode Reference sample 0 UA~UH 1 LA~LH 2 UA~UH, LA~LH3, 18, 10, 19, 4, 20, 11, 21, 26, 14, 27, 7, 28, 15, 29 UA~UH LA~LH,X22, 12, 23, 5, 24, 13, 25, 6 UA~UP 30, 16, 31, 8, 32, 17, 33, 9 LA~LP

With reference to Table 1, when a mode value of the prediction mode ofthe encoding target block is 0, samples UA to UH may be determined asreference samples of the encoding target block in FIG. 4 b . Also, whena mode value of the prediction mode of the encoding target block is 1,samples LA to LH may be determined as reference samples of the encodingtarget block in FIG. 4 b . Also, in the other prediction modes,reference samples of the encoding target block may be determinedaccording to corresponding angles.

The encoder may perform filtering on the determined reference samples.In this case, whether to apply filtering and an application range may bedetermined according to a size and/or a prediction mode of the encodingtarget block.

FIG. 5 is a conceptual view schematically showing an embodiment of amethod for determining whether to apply multi-sample prediction anddetermining a sample group according to an embodiment of the presentinvention.

The encoder may determine a representative prediction value with respectto the sample group comprised of a plurality of samples, and estimatethe plurality of samples of the sample group by using the determinedrepresentative prediction value at a time. As mentioned above, such aprediction method may be referred to as multi-sample prediction.

The encoder may determine whether to apply multi-sample prediction, asize of a sample group, and/or a shape of the sample group according tothe size of the encoding target block and at least one of intraprediction modes of the encoding target block. In this case, whether toapply multi-sample prediction, a size of a sample group, and/or a shapeof the sample group may be determined by a certain fixed value accordingto the size of the encoding target block and/or the intra predictionmode of the encoding target block.

Table 2 below shows the size of the encoding target block, whether toapply multi-sample prediction according to the intra prediction mode,and the size of the sample group according to an embodiment of thepresent invention.

TABLE 2 Block size Prediction mode 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1516 4×4 - - - - - - - - - - - - - - - - -8×8 - - - - - - - - - - - - - - - - -16×16 - - - - - - - - - - - - - - - - - 32×32 - - - - 2 2 - 2 2 - 2 2 22 2 2 2 64×64 - - - - 4 4 - 4 4 - 4 4 4 4 4 4 4 Block size Predictionmode 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 334×4 - - - - - - - - - - - - - - - - -8×8 - - - - - - - - - - - - - - - - -16×16 - - - - - - - - - - - - - - - - - 32×32 2 4 2 2 2 2 2 2 4 4 2 2 22 2 2 4 64×64 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

In Table 2, portions indicated by ‘-’ may be portions to whichmulti-sample prediction is not applied. Also, numbers allocatedaccording to the sizes of the encoding target block and the predictionmodes may represent the size of sample groups, namely, the number of aplurality of samples constituting sample groups.

For example, when the size of the encoding target block is 16×16 and theintra prediction mode of the encoding target block is 15, multi-sampleprediction may not be applied to the encoding target block. Also, whenthe size of the encoding target block is 32×32 and the intra predictionmode of the encoding target block is 18, multi-sample prediction may beapplied to the encoding target block. In this case, the size of thesample group used for multi-sample prediction may be 4.

Also, in determining the sample group, the encoder may determine theshape of the sample group differently according to the prediction mode(and/or prediction direction) of the encoding target block. Here, theshape of the sample group may indicate positions of the plurality ofsamples constituting the sample group.

FIG. 5 shows shapes of sample groups according to intra predictionmodes. In FIG. 5 , 515, 525, and 535 indicate encoding target blocks,respectively. In FIG. 5 , it is assumed that the size of the encodingtarget block is 8×8 and the size of the sample group is 2. Also, in FIG.5 , in 510, 520, and 530, two pixels represented by ‘a’ may constitute asingle sample group. Also, pixels represented by ‘b’, ‘c’, ‘d’, and ‘e’may also constitute a sample group in the same manner, respectively.

In the embodiments described hereafter, respective pixels in theencoding target block may be represented by coordinates [x,y]. Here, thex value may be increased toward the right side on the coordinate axis,and the y value may be increased downward.

Also, in FIG. 5 , in 540, a prediction mode group comprised ofprediction modes 542 between a prediction mode (mode value 3) in adirection of a left upper end and a prediction mode (mode value 0) in avertical direction and prediction modes 544 between a prediction mode(mode value 6) in a direction of right upper end and the prediction mode(mode value 0) in the vertical direction is referred to as a verticaldirection prediction mode group (Group_vert). Meanwhile, a predictionmode group comprised of prediction modes 546 between the prediction mode(mode value 3) in the direction of the left upper end and a predictionmode (mode value 1) in a horizontal direction and prediction modes 548between a prediction mode (mode value 9) in a direction of a left lowerend and the prediction mode (mode value 1) in the horizontal directionis referred to as a horizontal directional prediction mode group(Group_hor).

For example, it is assumed that an intro prediction mode of an encodingtarget block is a prediction mode corresponding to the verticaldirectional prediction mode group. In this case, the encoder maydetermine a shape of a sample group as shown in 510 in FIG. 5 . Namely,the encoder may determine two samples contiguous up and down as a singlesample group. In this case, when coordinates of one sample of the samplegroup is [x,y], coordinates of the other sample may be [x,y+1].

In another example, it is assumed that an intra prediction mode of anencoding target block is a prediction mode corresponding to thehorizontal directional prediction mode group. In this case, the encodermay determine a shape of a sample group as shown in 510 in FIG. 5 .Namely, the encoder may determine two samples contiguous left and rightas a single sample group. In this case, when coordinates of one sampleof the sample group is [x,y], coordinates of the other sample may be[x+1,y].

In another example, the encoder may determine two samples contiguous ina diagonal direction as shown in 530 in FIG. 5 as a single sample group.In this case, when coordinates of one sample of the sample group is[x,y], coordinates of the other sample may be [x-1,y+1].

FIG. 6 is a conceptual view schematically showing an embodiment of amethod for determining a representative position of each sample groupaccording to an embodiment of the present invention.

In FIG. 6 , 615, 625, 635, and 645 represent encoding target blocks,respectively, and the size of the respective encoding target blocks isassumed to be 8×8. In 610, 630, and 640 in FIG. 6 , two pixelsrepresented by ‘a’ may constitute a single sample group, and in 620 inFIG. 6 , four pixels represented by ‘a’ may constitute a single samplegroup. Also, pixels represented by ‘b’, ‘c’, ‘d’, and ‘e’ may alsoconstitute a sample group in the same manner, respectively.

As mentioned above, when it is determined to apply multi-sampleprediction, the encoder may determine a representative position withrespect to each sample group in the encoding target block. Here, therepresentative position may be determined according to positions of theplurality of samples constituting each sample group.

In an embodiment, the encoder may determine a position of a singlesample among the plurality of samples constituting a sample group, as arepresentative position with respect to the sample group. In this case,for example, a single sample corresponding to the representativeposition may be a sample closest to a reference sample among theplurality of samples constituting the sample group. Also, in anotherexample, a single sample corresponding to the representative positionmay be a sample existing at a particular position among the plurality ofsamples.

With reference to 610, 620, 630, and 640 in FIG. 6 , the encoder maydetermine a position of a sample closest to the reference sample in thesample group indicated by ‘a’ as a representative position with respectto the ‘a’ sample group. Also, the encoder may determine a position of asample closest to the reference sample in the sample group indicated by‘b’ as a representative position with respect to the ‘b’ sample group.In FIG. 6 , the representative position with respect to the ‘a’ samplegroup and the representative position with respect to the ‘b’ samplegroup are illustrated as black dots. Also, the encoder may determinerepresentative positions with respect to the sample groups correspondingto ‘c’, ‘d’, and ‘e’ in the same manner.

FIG. 7 is a conceptual view schematically showing another embodiment ofa method for determining a representative position of each sample groupaccording to an embodiment of the present invention.

In FIG. 7 , 715, 725, 735, and 745 represent encoding target blocks,respectively, and the size of the respective encoding target blocks isassumed to be 8×8. In 710, 730, and 740 in FIG. 7 , two pixelsrepresented by ‘a’ may constitute a single sample group, and in 720 inFIG. 7 , four pixels represented by ‘a’ may constitute a single samplegroup. Also, pixels represented by ‘b’, ‘c’, ‘d’, and ‘e’ may alsoconstitute a sample group in the same manner, respectively.

As mentioned above, when it is determined to apply multi-sampleprediction, the encoder may determine a representative position withrespect to each sample group in the encoding target block. Here, therepresentative position may be determined according to positions of theplurality of samples constituting each sample group. In this case, theencoder may determine a middle position between the plurality of samplesconstituting a sample group, as a representative position with respectto the sample group.

With reference to 710, 720, 730, and 740 in FIG. 6 , the encoder maydetermine a middle position of the plurality of samples constituting thesample group indicated by ‘a’, as a representative position with respectto the ‘a’ sample group. For example, in 710 in FIG. 7 , whencoordinates of two samples of the ‘a’ sample group are [x,y], [x,y+1],respectively, a representative position may be determined to be [x,y+½].Also, the encoder may determine a middle position of the plurality ofsamples constituting the sample group indicated by ‘b’ as arepresentative position with respect to the ‘b’ sample group. Forexample, in 710 in FIG. 7 , when coordinates of two samples of the ‘b’sample group are [x+1,y], [x+1,y+1], respectively, a representativeposition may be determined to be [x+1,y+½]. In FIG. 7 , therepresentative position with respect to the ‘a’ sample group and therepresentative position with respect to the ‘b’ sample group areillustrated as black dots. Also, the encoder may determinerepresentative positions with respect to the sample groups correspondingto ‘c’, ‘d’, and ‘e’ in the same manner.

FIG. 8 is a conceptual view schematically showing another embodiment ofa method for determining a representative position of each sample groupaccording to an embodiment of the present invention.

In FIG. 8 , 815, 825, 835, and 845 represent encoding target blocks,respectively, and the size of the respective encoding target blocks isassumed to be 8×8. In 810, 830, and 840 in FIG. 8 , two pixelsrepresented by ‘a’ may constitute a single sample group, and in 620 inFIG. 6 , four pixels represented by ‘a’ may constitute a single samplegroup. Also, pixels represented by ‘b’ may also constitute a samplegroup in the same manner, respectively.

As mentioned above, when it is determined to apply multi-sampleprediction, the encoder may determine a representative position withrespect to each sample group in the encoding target block. Here, therepresentative position may be determined according to, for example,positions of the plurality of samples constituting each sample group. Inthis case, the encoder may determine a position existing outside thesample group within the encoding target block, as a representativeposition with respect to the sample group.

With reference to 810, 820, 830, and 840 in FIG. 8 , the encoder maydetermine the position of the sample existing outside the ‘a’ samplegroup within the encoding target block, as a representative positionwith respect to the ‘a’ sample group. For example, in 810 in FIG. 8 ,when coordinates of two samples of the ‘a’ sample group are [x,y], [x,y+1], respectively, the representative position may be [x, y-2]. Also,the encoder may determine the position of the sample existing outsidethe ‘b’ sample group within the encoding target block, as arepresentative position with respect to the ‘b’ sample group. Forexample, in 820 in FIG. 8 , when coordinates of two samples of the ‘b’sample group are [x+1,y], [x+1, y+1], respectively, the representativeposition may be determined to be [x+1, y-2]. In FIG. 8 , therepresentative position with respect to the ‘a’ sample group and therepresentative position with respect to the ‘b’ sample group areillustrated as black dots.

FIG. 9 is a conceptual view schematically showing an embodiment of amethod of determining a representative prediction value of each samplegroup.

In FIG. 9 , 913 and 923 represent encoding target blocks, respectively,and the size of the encoding target blocks is assumed to be 8×8. In FIG.9 , [x,y] indicated within the encoding target blocks may representcoordinates of samples within the respective encoding target blocks.Also dark dots 916 and 926 indicated in 910 and 920 may denoterespective positions, respectively.

As mentioned above, the encoder may determine a representativeprediction value with respect to each sample group based on therepresentative positions with respect to each sample group.

In this case, the encoder may determine a reference sample used forcalculating a representative prediction value based on a prediction modand/or prediction direction of the encoding target blocks. Here, eachprediction mode and/or prediction direction may have a correspondingangle. The encoder may determine a reference position corresponding tothe representative position based on the angle, and determined whetheror not the determined reference position corresponds to an integerposition. Here, the reference position may corresponding to the sameposition as the position of a single reference sample, or may correspondto a position between a plurality of reference samples. Also, theinteger position may refer to a position that can be indicated bycoordinates of [n,m] (n and m are integers). Namely, when the referenceposition corresponds to an integer position, the reference position maybe the same as the position of the single reference sample.

With reference to 910 in FIG. 9 , the reference position correspondingto the representative position 916 may be an integer position. Here, asample value of the reference sample existing in the integer positionmay be determined as a representative prediction value corresponding tothe representative position 916.

For example, when the representative position 916 is [0,3], a referencesample value of the integer position corresponding to the representativeposition 916 may be E. Here, the encoder may determine E as arepresentative prediction value with respect to the representativeposition 916. This may be expressed by Equation 1 shown below.

$\begin{matrix}{\text{predRep}\left\lbrack {0,3} \right\rbrack = \text{E}} & \text{­­­[Equation 1]}\end{matrix}$

Here, predRep[x,y] may indicate a representative prediction value withrespect to the representative position of [x,y].

With reference to 920 in FIG. 9 , a reference position corresponding tothe representative position 926 may not be an integer position. Forexample, when the representative position 926 is [1,0], a referenceposition corresponding to the representative position 926 may be aposition existing between a reference sample A of an integer positionand a reference sample B of an integer position. Namely, when thereference position corresponding to the representative position 926[1,0] is not an integer position, the plurality of reference samples(A,B) may correspond to the representative position 926.

In this case, in an embodiment of the present invention, among theplurality of reference samples corresponding to the representativeposition, the encoder may determine a sample value of a reference samplecloser to the prediction direction of the representative position, as arepresentative prediction value corresponding to the representativeposition. For example, in the embodiment of 920 in FIG. 9 , when it isassumed that the reference sample B is positioned to be closer to theprediction direction of the representative position 926 than thereference sample A does, the encoder may determine the reference sampleB as a representative prediction value corresponding to therepresentative position 926. This may be expressed by Equation 2 shownbelow.

$\begin{matrix}{\text{predRep}\left\lbrack {1,0} \right\rbrack = \text{B}} & \text{­­­[Equation 2]}\end{matrix}$

In another embodiment, when the reference position corresponding to therepresentative position is not an integer position, the encoder maydetermine a representative prediction value with respect to therepresentative position by perform interpolation on the sample values ofthe plurality of reference samples corresponding to the representativeposition. For example, as in 920 in FIG. 9 , when the representativeposition 926 is [1,0], the reference samples corresponding to therepresentative position 926 are A and B, the encoder may derive arepresentative prediction value by performing interpolation by using adecimal distance between the reference sample A and the reference sampleB. This may be expressed by Equation 3 shown below:

$\begin{matrix}{\text{predRep}\left\lbrack {1,0} \right\rbrack = \left( {\left( {32\text{-iFact}} \right)\text{*A + iFact*B + 16}} \right) > > 5} & \text{­­­[Equation 3]}\end{matrix}$

Here, iFact may indicate a decimal distance between the reference sampleA and the reference sample B. Also, A may indicate a sample value of thereference sample A, and B may indicate a sample value of the referencesample B. According to the embodiment of Equation 3, the encoder mayperform interpolation between the plurality of reference samples withaccuracy of 1/32.

iFact may be derived by using a certain angle and/or a certain initialangle. Here, the certain angle and the certain initial angle maycorrespond to values obtained by expressing a distance of 1/32 unit inthe form of an angle (namely, the certain angle and the certain initialangle may correspond to distance values of 1/32 unit, which areexpressed in the form of an angle), and may be set to be different foreach intra prediction mode. Table 3 below shows an embodiment of anglesand initial angles according to intra prediction modes.

TABLE 3 Prediction mode set 1 2 3 4 5 6 7 Angle 2 5 9 13 17 21 26Initial angle 1 2 4 6 8 10 13

Here, the prediction mode set may indicate a group comprised of intraprediction modes having the same angle and the same initial angle. Whenthe reference position corresponding to the representative position isnot an integer position, iFact value may be derived by using a valueobtained by the angle value and the initial angle value according to theintra prediction mode of the encoding target block.

Also, in another embodiment, when the reference position correspondingto the representative position is not an integer position, the encodermay determine an average value of a plurality of reference samplescorresponding to the representative position, as a representativeprediction value with respect to the representative position. Forexample, in 920 in FIG. 9 , when the representative position 926 is[1,0] and reference samples corresponding to the representative position926 are A and B, the encoder may determine a sample average value of thereference sample A and the reference sample B, as a representativeprediction value corresponding to the representative position 926. Thismay be expressed by Equation 4 shown below.

$\begin{matrix}{\text{predRep}\left\lbrack {1,0} \right\rbrack = \left( \text{A+B+1} \right) > > 1} & \text{­­­[Equation 4]}\end{matrix}$

When the representative prediction value corresponding to therepresentative position is determined, the encoder may determine asample prediction value with respect to each of the plurality of samplesof the sample group corresponding to the representative position byusing the determined representative prediction value. For example, aprediction value with respect to each of the plurality of samplesconstituting a single sample group may be determined to be the samevalue as the representative prediction value corresponding to the samplegroup. Namely, the representative prediction value may be used as aprediction value of the plurality of samples of the corresponding samplegroup. Hereinafter, embodiments of a method of driving a predictionvalue with respect to a plurality of samples of a sample group will bedescribed.

FIG. 10 is a conceptual view schematically showing an embodiment of amethod of deriving a prediction value with respect to a plurality ofsamples of a sample group.

FIG. 10 illustrates an embodiment in which a representative positionwith respect to a single sample group is determined as a position of asingle sample among a plurality of samples constituting the samplegroup. Namely, the embodiment illustrated in FIG. 10 may correspond tothe embodiment illustrated in FIG. 6 . 1015 and 1025 in FIG. 10represent encoding target blocks, respectively, and the size of therespective encoding target blocks is assumed to be 8×8. In FIG. 10 ,[x,y] indicated within the encoding target blocks may representcoordinates of samples within the respective encoding target blocks.

In 1010 in FIG. 10 , {[0,0], [0,1]}, {[1,0], [1,1]}, {[2,0], [2,1]},{[3,0], [3,1]}, {[4,0], [4,1]} may represent a single sample group,respectively, and in 1020 in FIG. 10 , {[0,0], [1,0]}, {[0,1], [1,1]},{[0,2], [1,2]}, {[0,3], [1,3]}, {[0,4], [1,4]} may represent a singlesample group, respectively. In 1010 in FIG. 10 , [0,0] indicated by ablack dot may denote a representative position with respect to a samplegroup {[0,0], [0,1]}, and [1,0] indicated by a black dot may denote arepresentative position with respect to a sample group {[1,0], [1,1]}.Also, in 1020 in FIG. 10 , [0,0] indicated by a black dot may denote arepresentative position with respect to a sample group {[0,0], [1,0]},and [0,1] indicated by a black dot may denote a representative positionwith respect to a sample group {[0,1], [1,1]}.

In this case, the encoder may determine a representative predictionvalue corresponding to a single sample group, as a prediction value withrespect to the plurality of samples of the sample group. For example, in1010 in FIG. 10 , the representative position with respect to the samplegroup {[1,0], [1,1]} is [1,0], so the encoder may determine arepresentative prediction value with respect to the representativeposition [1,0], as a prediction value of the samples positioned at thecoordinates [1,0] and [1,1]. This may be expressed by Equation 5 shownbelow.

$\begin{matrix}{\text{predSamples}\left\lbrack {1,0} \right\rbrack = \text{predSamples}\left\lbrack {1,1} \right\rbrack = \text{predRep}\left\lbrack {1,0} \right\rbrack} & \text{­­­[Equation 5]}\end{matrix}$

Here, predSamples[x,y] may represent a prediction value of the samplepositioned at the coordinates [x,y].

When the foregoing content is generalized, in 1010 in FIG. 10 , therepresentative with respect to the sample group {[x,y], [x,y+1]} may be[x,y]. In this case, the encoder may determined a representativeprediction value with respect to the representative position [x,y], as aprediction value of the sample positioned at the coordinates [x,y] and[x,y+1]. This may be expressed by Equation 6 shown below.

$\begin{matrix}{\text{predSamples}\left\lbrack \text{x,y} \right\rbrack = \text{predSamples}\left\lbrack \text{x,y+1} \right\rbrack = \text{predRep}\left\lbrack \text{x,y} \right\rbrack} & \text{­­­[Equation 6]}\end{matrix}$

Also, in 1020 in FIG. 10 , a representative position with respect to thesample group {[x,y], [x+1,y]} may be [x,y]. In this case, the encodermay determined a representative prediction value with respect to therepresentative position [x,y], as a prediction value of the samplepositioned at the coordinates [x,y] and [x+l,y]. This may be expressedby Equation 7 shown below.

$\begin{matrix}{\text{predSamples}\left\lbrack \text{x,y} \right\rbrack = \text{predSamples}\left\lbrack \text{x+1,y} \right\rbrack = \text{predRep}\left\lbrack \text{x,y} \right\rbrack} & \text{­­­[Equation 7]}\end{matrix}$

FIG. 11 is a conceptual view schematically showing another embodiment ofa method of deriving a prediction value with respect to a plurality ofsamples of a sample group.

FIG. 11 illustrates an embodiment in which a representative positionwith respect to a single sample group is determined as a middle positionof the plurality of samples constituting the sample group. Namely, theembodiment illustrated in FIG. 11 may correspond to the embodimentillustrated in FIG. 7 . 1115 and 1125 in FIG. 11 represent encodingtarget blocks, respectively, and the size of the respective encodingtarget blocks is assumed to be 8×8. In FIG. 11 , [x,y] indicated withinthe encoding target blocks may represent coordinates of samples withinthe respective encoding target blocks.

In 1110 in FIG. 11 , {[0,0], [0,1], [1,0], [1,1]}, {[2,0], [2,1], [3,0],[3,1]}, {[4,0], [4,1], [5,0], [5,1]}, {[6,0], [6,1], [7,0], [7,1]} mayrepresent a single sample group, respectively, and in 1120 in FIG. 11 ,{[3,1], [4,0]}, {[4,1], [5,0]}, {[5,1], [6,0]}, {[6,1], [7,0]} mayrepresent a single sample group, respectively. In 1110 in FIG. 11 , ablack dot indicated at the middle position of coordinates [0,0], [0,1],[1,0], [1,1] may represent a representative position with respect to thesample group {[0,0], [0,1], [1,0], [1,1]}, and a black dot indicated atthe middle position of coordinates [2,0], [2,1], [3,0], [3,1] mayrepresent a representative position of the sample group {[2,0], [2,1],[3,0], [3,1]}. Also, in 1120 in FIG. 11 , a black dot indicated at themiddle position of coordinates [4,1], [5,0] may represent arepresentative position with respect to the sample group {[4,1], [5,0]},and a black dot indicated at the middle position of coordinates [5,1],[6,0] may represent a representative position with respect to the samplegroup {[5,1], [6,0]}.

In this case, the encoder may determine a representative predictionvalue corresponding to a single sample group, as a prediction value withrespect to a plurality of samples of the sample group.

In 1110 in FIG. 11 , a representative position with respect to a samplegroup {[x,y], [x,y+1], [x+1,y], [x+1,y+1]} may be [x+0.5, y+0.5]. Inthis case, the encoder may determine a representative prediction valuewith respect to the representative position [x+0.5, y+0.5], as aprediction value of the samples positioned at the coordinates [x,y],[x,y+1], [x+1,y], [x+1,y+1]. This may be expressed by Equation 8 shownbelow.

$\begin{matrix}\begin{array}{l}{\text{predSamples}\left\lbrack \text{x,y} \right\rbrack = \text{predSamples}\left\lbrack \text{x,y+1} \right\rbrack =} \\{\text{predSamples}\left\lbrack \text{x+1,y} \right\rbrack = \text{predSamples}\left\lbrack \text{x+1,y+1} \right\rbrack =} \\{\text{predRep}\left\lbrack {\text{x+0}\text{.5,y+0}\text{.5}} \right\rbrack}\end{array} & \text{­­­[Equation 8]}\end{matrix}$

Also, in 1120 in FIG. 11 , a representative position with respect to thesample group {[x,y], [x-1,y+1]} may be [x-0.5, y+0.5]. In this case, theencoder may determine a representative prediction value with respect tothe representative position [x-0.5, y+0.5], as a prediction value of thesamples positioned at the coordinates [x,y], [x-1,y+1]. This may beexpressed by Equation 9 shown below.

$\begin{matrix}\begin{array}{l}{\text{predSamples}\left\lbrack \text{x,y} \right\rbrack = \text{predSamples}\left\lbrack \text{x-1,y+1} \right\rbrack =} \\{\text{predRep}\left\lbrack {\text{x-0}\text{.5,y+0}\text{.5}} \right\rbrack}\end{array} & \text{­­­[Equation 9]}\end{matrix}$

FIG. 12 is a conceptual view schematically showing another embodiment ofa method of deriving a prediction value with respect to a plurality ofsamples of a sample group.

FIG. 12 illustrates an embodiment in which a representative positionwith respect to a single sample group is determined as a positionexisting outside the sample group within an encoding target block.Namely, the embodiment illustrated in FIG. 12 may correspond to theembodiment illustrated in FIG. 8 . 1215 and 1225 in FIG. 12 representencoding target blocks, respectively, and the size of the respectiveencoding target blocks is assumed to be 8×8. In FIG. 12 , [x,y]indicated within the encoding target blocks may represent coordinates ofsamples within the respective encoding target blocks.

In 1210 in FIG. 12 , {[0,4], [0,5]}, {[1,4], [1,5]} may represent asingle sample group, respectively, and in 1220 in FIG. 12 , {[2,0],[3,0]}, {[2,1], [3,1]} may represent a single sample group,respectively.

In 1210 in FIG. 12 , a black dot indicated at the position ofcoordinates [0,2] may represent a representative position with respectto the sample group {[0,4], [0,5]}, and a black dot indicated at theposition of coordinates [1,2] may represent a representative position ofthe sample group {[1,4], [1,5]}. Also, in 1220 in FIG. 12 , a black dotindicated at the position of coordinates [1,0] may represent arepresentative position with respect to the sample group {[2,0], [3,0]},and a black dot indicated at the position of coordinates [1,1] mayrepresent a representative position with respect to the sample group{[2,1], [3,1]}.

In this case, the encoder may determine a representative predictionvalue corresponding to a single sample group, as a prediction value withrespect to a plurality of samples of the sample group.

In 1210 in FIG. 12 , a representative position with respect to thesample group {[x,2*y], [x,2*y+1]} may be [x,y]. In this case, theencoder may determine a representative prediction value with respect tothe representative position [x,y], as a prediction value of the samplepositioned at the coordinates [x,2*y], [x,2*y+1]. This may be expressedby Equation 10 shown below.

$\begin{matrix}{\text{predSamples}\left\lbrack \text{x, 2*y} \right\rbrack = \text{predSamples}\left\lbrack \text{x, 2*y+1} \right\rbrack = \text{predRep}\left\lbrack \text{x, y} \right\rbrack} & \text{­­­[Equation 10]}\end{matrix}$

Also, in 1220 in FIG. 12 , a representative position with respect to thesample group {[2*x,y], [2*x+l,y]} may be [x,y]. In this case, theencoder may determine a representative prediction value with respect tothe representative position [x,y], as a prediction value of the samplepositioned at the coordinates [2*x,y], [2*x+1,y]. This may be expressedby Equation 11 shown below.

$\begin{matrix}{\text{predSamples}\left\lbrack \text{2*x, y} \right\rbrack = \text{predSamples}\left\lbrack \text{2*x+1, y} \right\rbrack = \text{predRep}\left\lbrack \text{x, y} \right\rbrack} & \text{­­­[Equation 11]}\end{matrix}$

According to an embodiment of the present invention, a plurality ofsamples of a sample group corresponding to the representative predictionvalue can be predicted at a time through the single interpolationprocess for deriving the representative prediction value. Thus, thenumber of times of performing the interpolation process can be reduced,and both the amount of calculation and complexity can also be reduced.

In the exemplary system as described above, the methods are describedbased on the flow chart by sequential steps or blocks, but the presentinvention is not limited to the order of the steps, and a step may beperformed in different order from another step as described above orsimultaneously performed. It would be understood by a skilled person inthe art that the steps are not exclusive, a different step may beincluded, or one or more of the steps of the flow chart may be deletedwithout affecting the scope of the present invention.

The embodiments of the present invention have been described withreference to the accompanying drawings, and it will be apparent to thoseskilled in the art that various modifications and variations can be madein the present invention without departing from the scope of theinvention. Thus, the technical idea of the present invention should beinterpreted to embrace all such alterations, modifications, andvariations in addition to the accompanying drawings.

What is claimed is:
 1. An image decoding method performed by an imagedecoding apparatus, comprising: determining that multi-sample predictionis applied to a current block based on an intra prediction mode of thecurrent block, the current block being a prediction unit to which theintra prediction mode is applied; determining a representativeprediction value for a sample group, the sample group being a regioninside the current block, being smaller than the current block, andbeing predicted as the same representative prediction value; predictinga plurality of samples included in the sample group using the determinedrepresentative prediction value; generating a prediction block of thecurrent block based on the determined representative prediction value;and generating a residual block of the current block based on atransform coefficient for the current block, wherein the representativeprediction value is determined as an average value of a plurality ofreference samples, wherein other samples inside the current block whichare not included in the sample group are predicted differently from theplurality of samples included in the sample group, wherein themulti-sample prediction is performed based on a determination of whetherthe size of the current block is less than 32×32.
 2. The image decodingmethod of claim 1, wherein a size of the sample group is determinedbased on the size of the current block.
 3. An image encoding methodperformed by an image encoding apparatus, comprising: determining thatmulti-sample prediction is applied to a current block based on an intraprediction mode of the current block, the current block being aprediction unit to which the intra prediction mode is applied;determining a representative prediction value for a sample group, thesample group being a region inside the current block, being smaller thanthe current block, and being predicted as the same representativeprediction value; predicting a plurality of samples included in thesample group using the determined representative prediction value;generating a prediction block of the current block based on thedetermined representative prediction value; generating a residual blockof the current block based on the prediction block; and generating atransform coefficient for the residual block of the current block,wherein the representative prediction value is determined as an averagevalue of a plurality of reference samples, wherein other samples insidethe current block which are not included in the sample group arepredicted differently from the plurality of samples included in thesample group, wherein the multi-sample prediction is performed based ona determination of whether the size of the current block is less than32×32.
 4. The image encoding method of claim 3, wherein a size of thesample group is determined based on a size of the current block.
 5. Anon-transitory computer-readable recording medium storing a bitstreamwhich is received and decoded by an image decoding apparatus and used toreconstruct an image, wherein the bitstream comprises information on anintra prediction mode of a current block and information on a residualblock of the current block; the information on an intra prediction modeof the current block is used to generate an intra prediction mode of thecurrent block; the intra prediction mode of the current block is used todetermine that multi-sample prediction is applied to the current block,the current block being a prediction unit to which the intra predictionmode is applied; wherein a representative prediction value for a samplegroup is determined, the sample group being a region inside the currentblock, being smaller than the current block, and being predicted as thesame representative prediction value; the determined representativeprediction value is used to predict a plurality of samples included inthe sample group and to generate a prediction block of the currentblock; the information on the residual block of the current blockcomprises information on a transform coefficient for a residual block ofthe current block which is used to generate the residual block of thecurrent block; wherein the representative prediction value is determinedas an average value of a plurality of reference samples, wherein othersamples inside the current block which are not included in the samplegroup are predicted differently from the plurality of samples includedin the sample group, and wherein the multi-sample prediction isperformed based on a determination of whether the size of the currentblock is less than 32×32.